import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/home/index.vue";

const routes = [
    {
        path: "/",
        name: "home",
        component: HomeView,
    },
    {
        path: "/kind",
        name: "kind",
        component: () => import("../views/kind/index.vue"),
    },
    {
        path: "/cart",
        name: "cart",
        component: () => import("../views/cart/index.vue"),
    },
    {
        path: "/my",
        name: "my",
        component: () => import("../views/my/index.vue"),
    },
    {
        path: "/login",
        name: "login",
        // 利用 路由元信息 帮助我们区分到底那个页面需要展示 底部导航
        meta: {
            // 当前的对象内部可以书写我们的路由元信息
            hidden: true, // 路由元信息说白了就是给路由添加一些特殊的标识
        },
        component: () => import("../views/login/index.vue"),
    },
    {
        path: "/register",
        name: "register",
        meta: {
            hidden: true,
        },
        component: () => import("../views/register/index.vue"),
        children: [
            {
                path: 'no1',
                name: 'no1',
                component: () => import("../views/register/no1.vue"),
            },
            {
                path: 'no2',
                name: 'no2',
                component: () => import("../views/register/no2.vue"),
            },
            {
                path: 'no3',
                name: 'no3',
                component: () => import("../views/register/no3.vue"),
            }
        ]
    },
];

const router = createRouter({
    history: createWebHashHistory(import.meta.env.BASE_URL),
    routes,
});

export default router;
